﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Addr.aspx.cs" Inherits="Maticsoft.Web.Addr" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="js/jquery-1.8.2.js" type="text/javascript"></script>
    <script src="js/layer/layer.js" type="text/javascript"></script>
    <style type="text/css">
    body{font-size:13px;}
    input{height:25px;}
    .star{color:Red;}
    </style>
    <script type="text/javascript">
        var index = parent.layer.getFrameIndex(window.name);
        $(function () {
//            $('#btnSubmit').click(function () {
//                SubmitData();
//            });

            $('#btnCancel').click(function () {
                parent.layer.close(index);
            });
        })

        function SubmitData() {
            if ($("#txtName").val() == "") {
                alert("请添加姓名");
                return false;
            }
            if ($("#txtMobile").val() == "") {
                alert("请添加手机号");
                return false;
            }
            else if ($("#txtMobile").val().length != 11) {
                alert("手机格式错误");
                return false;
            }
            if ($("#txtPostCode").val() == "") {
                alert("请输入邮编");
                return false;
            }
            if ($("#txtAddress").val() == "") {
                alert("请输入详细地址");
                return false;
            }
            if ($("#ddlCity").val() == "-1") {
                alert("请选择地区");
                return false;
            }
            if ($("#txtIndentityNo").val() == "") {
                alert("请输入身份证号码");
                return false;
            }
//            $.ajax({
//                type: "get",
//                url: "Addr.aspx",
//                data: "sync=true&name=" + escape($("#txtName").val()) + "&mobile=" + $("#txtMobile").val() + "&code=" + $("#txtPostCode").val() + "&addr=" + escape($("#txtAddress").val()) + "&d=" + new Date().toString(),
//                success: function (data) {
//                    if (data == "1") {
//                        //parent.layer.close(index);
//                        parent.window.location.href = "Settlement.aspx";
//                    }
//                },
//                error: function (data) {
//                    alert("出错啦");
//                }
            //            })
            return true;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <table border="0" cellpadding="0" cellspacing="0" width="95%">
        <tr>
            <td align="right" height="30">
               
            </td>
            <td align="left">
                
            </td>
        </tr>
        <tr>
            <td align="right" height="40" width="25%">
                姓名：
            </td>
            <td align="left">
                <input id="txtName" type="text" runat="server" /> <span class="star">*</span>
            </td>
        </tr>
        <tr>
            <td align="right" height="40">
                手机：
            </td>
            <td align="left">
                <input id="txtMobile" type="text" class="input1" runat="server" /> <span class="star">*</span>
            </td>
        </tr>
        <tr>
            <td align="right" height="40">
                地区：
            </td>
            <td align="left">
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                <asp:DropDownList ID="ddlProvince" runat="server" AutoPostBack="True" 
                        onselectedindexchanged="ddlProvince_SelectedIndexChanged">
                </asp:DropDownList>
                <asp:DropDownList ID="ddlCity" runat="server">
                </asp:DropDownList>
                <span class="star">*</span>
                </ContentTemplate>
                </asp:UpdatePanel>
                
            </td>
        </tr>
        <tr>
            <td align="right" height="40">
                详细地址：
            </td>
            <td align="left">
                <input id="txtAddress" type="text" class="input1" style="width:270px;" runat="server" /> <span class="star">*</span>
            </td>
        </tr>
        <tr>
            <td align="right" height="40">
                邮编：
            </td>
            <td align="left">
                <input id="txtPostCode" type="text" class="input1" runat="server" /> <span class="star">*</span>
            </td>
        </tr>
        <tr>
            <td align="right" height="40">
                默认地址：
            </td>
            <td align="left">
                <input id="cbMain" type="checkbox" runat="server" />
            </td>
        </tr>
        <tr>
            <td align="right" height="40">
                身份证号：
            </td>
            <td align="left">
                <input id="txtIndentityNo" type="text" class="input1" style="width:270px;" runat="server" /> <span class="star">*</span>
            </td>
        </tr>
        <tr>
            <td align="right" height="40">
                正面：
            </td>
            <td align="left">
                <input id="fileFront" runat="server" type="file" />
            </td>
        </tr>
        <tr>
            <td align="right" height="40">
                
            </td>
            <td align="left">
                <asp:Image ID="imgFront" ImageUrl="~/img/shenfenzheng.jpg" runat="server" Width="200px" />
            </td>
        </tr>
        <tr>
            <td align="right" height="40">
                反面：
            </td>
            <td align="left">
                <input id="fileBack" runat="server" type="file" />
            </td>
        </tr>
        <tr>
            <td align="right" height="40">
                
            </td>
            <td align="left">
                <asp:Image ID="imgBack" ImageUrl="~/img/shenfenfan.jpg" runat="server" Width="200px" />
            </td>
        </tr>
        <tr>
            <td align="right" height="40">
                注意：
            </td>
            <td align="left" style="color:Red;font-size:12px;">
                为了积极配合海关清关，新西兰仓等海外仓订单身份证正反面上传项目为必选，国内仓目前仅需要填写身份证号即可，请务必保证收件人姓名和身份证号码、身份证上传信息一致
            </td>
        </tr>
        <tr>
            <td height="40">
            </td>
            <td align="left">
                <input name="hidNewsId" type="hidden" id="hidNewsId" value="" runat="server" />
                <asp:Button ID="btnSubmit" runat="server" Text=" 提交 " 
                    onclick="btnSubmit_Click" OnClientClick="return SubmitData();" />
                <input id="btnCancel" type="button" value=" 取消 " />
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
